<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>{{ purchase_date.page_date }}</h1>
<h2>page_id {{ purchase_date.page_id }}</h2>
{% regroup purchase_date_price by food as food_list %}
<table>
    <thead>
    <tr>
        <th></th>
        {% for m in markets %}
            <th>{{ m.market_name }}</th>
        {% endfor %}
    </tr>
    </thead>


    <tbody>
    {% for food in food_list %}
        <tr>
            <th>{{ food.grouper }}</th>

            {% for p in food.list %}
                {% if p.price %}
                    <td>{{ p.price }}</td>
                {% else %}
                    <td></td>
                {% endif %}
            {% endfor %}
        </tr>
    {% endfor %}


    </tbody>
</table>


</body>
</html>